import { createApp } from 'vue'
import index from '@/index.vue'
import { store } from '@/store/'
import router from '@/router/index'
import vant from '@/plugins/vant'
import element from '@/plugins/element'

import * as icons from '@element-plus/icons-vue'

import '@/assets/scss/vant.scss'
import '@/assets/scss/global-var.scss'
import '@/assets/scss/global.scss'

//环境变量
const env_ = import.meta.env
export const env = {
  webUrl: env_.VITE_APP_WEB_URL,
  baseUrl: env_.VITE_APP_WEB_URL,
  publicPath: env_.VITE_APP_WEB_URL,
  apiUrl: env_.VITE_APP_API_URL,
}
export const app = createApp(index)

// 全局注册el-icon
Object.keys(icons).forEach(key => {
  app.component(key, icons[key])
})
//配置全局属性

app.config.globalProperties.env = env
app.config.globalProperties.isH5Edit = true

app.use(router)
app.use(store)
app.use(vant)
app.use(element)

app.mount('#app')

